<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="/css/modules/register.css"/>
		<script src="../libs/js/utils.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<header>
			<div class="content-center">
				<a class="logo" href="">
				    <div class="logo-img"></div>
				    <span class="logo-name">黑鲨商城</span>
				</a>
			</div>
		</header>
		
		
		<section class="content">
			<div class="content-center">
				<div class="form">
					<p class="title">注册</p>
					<input type="text" class="userid" id="name" placeholder="请输入手机号" />
					<input type="text" class="checkword" id="" placeholder="请输入验证码" />
					<span class="yanzhengma">获取验证码</span>
					<input type="password" class="password" id="pwd"  placeholder="请输入密码" />
					<input type="password" class="checkpassword" id=""  placeholder="请确认密码" />
					<a href="/html/logoin.html" class="tologoin">账号登录</a>
					<div class="registerbtn">注册</div>
					<!-- <button class="registerbtn">注册</button> -->
					
					<div class="agreement-col" data-value="checked">
						<label for="agreement" class="checkboxCol active">
							<div class="icon-select-col">
								<i class="icon-select animate-common"></i>
								<!--<i class="fa fa-check"></i>-->
							</div>
							<span>我已阅读并接受<a href="agreement.html">《黑鲨服务协议》</a></span>
						</label>
					</div>
				</div>
			</div>
		</section>
		
		
		<script type="text/javascript">
			var form = document.querySelector('.registerbtn')
			var nameInput = document.querySelector('#name')
			var pwdInput = document.querySelector('#pwd')
			form.onclick = function(){
				const name = nameInput.value
				const pwd = pwdInput.value
				utils.post('http://localhost/black-shark/gulp-project/src/api/register.php',{name,pwd},resp =>{
					if(resp.code === 200){
						alert(resp.body.msg + '，即将跳转登录页')
						location.href = './logoin.html'
					}else{
						alert(resp.body.msg)
					}
				})
				return false
			}
		</script>
	</body>
</html>
